<%@page import="model.CategoryImp"%>
<%@page import="java.util.List"%>
<%@page import="model.entity.Category"%>
<%@page import="model.entity.Account"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div class="tab_container">
        <div id="tab2" class="tab_content" style="display: block;">
           <h2>Edit Category</h2>
           
           	<p>
                 
         	</p>
<%
    Category catedit = (Category)request.getAttribute("editcat");
%>   
                <form action="<c:url value="<%= "/admin/category/edit/" + catedit.getCategoryid() %>"/>" method="POST" name="frmedit" >
                    
              <label for="cbo">Category Id:</label><%= catedit.getCategoryid() %>
             
             <p>
                  <label>Category Name:  </label><br/>
                  <input readonly="true" type="text" class="text small" value="<%= catedit.getCategoryname() %>" name="oldcategoryname" > 
              </p>
              <p>
                  <label>New Category Name:  </label><br/>
                  <input type="text" class="text small" name="categoryname" > 
              </p>
              
            <label for="cbo">Parent Category:</label>
<%
    if(catedit.getParentid() == 0)
               {
%>Root
<input hidden="true" type="text" class="text small" value="<%= catedit.getParentid() %>" name="parentid" >
<%
    }else
               {
%>            
            <select name="parentid" id="cbo" class="select">
<%
    CategoryImp cim = new CategoryImp();
    List<Category> listparent = cim.ParentCategory();
for(Category list : listparent)
         {

%>  
<option value="<%= list.getCategoryid() %>"><%= list.getCategoryname() %></option>
<%
   }
    
%>  
  
            </select>   
<%}%>

            </p>

                <p>
          	<input type="submit" class="submit" value="Submit">
       		</p>
                
           </form>
        </div>
</div>